<h2>{{ 'AbpSettingManagement::Menu:Emailing' | abpLocalization }}</h2>
<nz-divider></nz-divider>
<form
  nz-form
  *ngIf="validateForm"
  [formGroup]="validateForm"
  [nzLayout]="'vertical'"
  (ngSubmit)="submitForm()"
>
  <ng-template #dropIcon>
    <i nz-icon nzType="down"></i>
  </ng-template>
  <nz-form-item>
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::DefaultFromDisplayName' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="defaultFromDisplayName"
        placeholder="{{ 'AbpSettingManagement::DefaultFromDisplayName' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::DefaultFromAddress' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="defaultFromAddress"
        placeholder="{{ 'AbpSettingManagement::DefaultFromAddress' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::SmtpHost' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="smtpHost"
        placeholder="{{ 'AbpSettingManagement::SmtpHost' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::SmtpPort' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="smtpPort"
        placeholder="{{ 'AbpSettingManagement::SmtpPort' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-control [nzSpan]="9">
      <label nz-checkbox formControlName="smtpEnableSsl">{{
        'AbpSettingManagement::SmtpEnableSsl' | abpLocalization
      }}</label>
    </nz-form-control>
    <nz-form-control [nzSpan]="9">
      <label nz-checkbox formControlName="smtpUseDefaultCredentials">{{
        'AbpSettingManagement::SmtpUseDefaultCredentials' | abpLocalization
      }}</label>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="!validateForm?.get('smtpUseDefaultCredentials').value">
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::SmtpDomain' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="smtpDomain"
        placeholder="{{ 'AbpSettingManagement::SmtpDomain' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="!validateForm?.get('smtpUseDefaultCredentials').value">
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::SmtpUserName' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="smtpUserName"
        placeholder="{{ 'AbpSettingManagement::SmtpUserName' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="!validateForm?.get('smtpUseDefaultCredentials').value">
    <nz-form-label [nzSpan]="20" nzRequired>{{
      'AbpSettingManagement::SmtpPassword' | abpLocalization
    }}</nz-form-label>
    <nz-form-control [nzSpan]="20" nzHasFeedback>
      <input
        nz-input
        formControlName="smtpPassword"
        placeholder="{{ 'AbpSettingManagement::SmtpPassword' | abpLocalization }}"
      />
    </nz-form-control>
  </nz-form-item>
</form>
<button
  nz-button
  nzType="primary"
  (click)="submitForm()"
  [disabled]="!validateForm || validateForm.invalid || !isFormChanged"
>
  保存
</button>
